package cn.cdeden.knowledge.mapper;


import cn.cdeden.knowledge.domain.TeamMember;
import cn.cdeden.knowledge.domain.dto.UserHideInfoDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
* @author Chen
* @date 2022-09-06
*/
@Repository
public interface TeamMemberMapper extends BaseMapper<TeamMember> {


    List<TeamMember> queryByTeamId(@Param("teamId") String teamId, @Param("nickName") String nickName, @Param("startPage") Integer startPage, @Param("endPage") Integer endPage, @Param("roleId") List<String> roleId, @Param("objectTypes") List<String> objectTypes);

    Integer queryByTeamIdCount(@Param("teamId") String teamId, @Param("nickName") String nickName,@Param("roleId") List<String> roleId, @Param("objectTypes") List<String> objectTypes);

    int updateByUserId(Integer teamId, Long objectId,int objectType,String roleId);

    List<UserHideInfoDto> queryUserByDeptIds(@Param("deptIds")Set<Long> deptIds, @Param("nickName") String nickName);

    List<UserHideInfoDto> queryUserByRoleId(Long objectId, String nickName);

    List<UserHideInfoDto> queryUserByJobId(Long objectId, String nickName);

    List<TeamMember> queryByObjectType(String teamId, String nickName, Integer objectType);
}
